Skip to content

feat(identity): add invite to Users service#609

Open
Sarath1018 wants to merge 2 commits into
feat/identity-users-crudfrom
feat/identity-users
Open

feat(identity): add invite to Users service#609
Sarath1018 wants to merge 2 commits into
feat/identity-users-crudfrom
feat/identity-users

Conversation

@Sarath1018

@Sarath1018 Sarath1018 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

PR 3 of 3 splitting the Identity user management onboarding (stacked on #617, which stacks on #616). Adds the final method:

SDK method Endpoint
invite(users) POST /api/User/InviteUsers

Each invited user receives an invitation email with an accept link that redirects to redirectUrl. The API reports per-user outcomes — the request can succeed overall while individual invitations fail, surfaced via success/errorMessage on each entry.

Design notes

  • Live-API findings encoded (Swagger spec is wrong/incomplete on these):
    • redirectUrl is effectively required and must be an allowed portal acceptInvite URL — the API gateway host is rejected per-user with Redirect URL is not valid
    • failed invitations return an all-zeros GUID as the user id
    • per-user errorMsg is renamed to errorMessage in the SDK
  • Outbound rename via transformRequest: groupIds→groupIDs.
  • New optional integration-test config UIPATH_PORTAL_URL for environments where UIPATH_BASE_URL points at the API gateway host.

Testing

  • Unit: 3 new tests (payload renames, per-user failure mapping, error propagation)
  • Integration: 2 new tests passing against live alpha (successful invite incl. retrieval of the pending-invite user, and per-user failure for a disallowed redirect URL); full identity suite 8/8
  • typecheck ✓, oxlint ✓, full unit suite passing

Stack

  1. feat(identity): onboard Users service with getById #616 — service scaffold + getById
  2. feat(identity): add updateById, deleteById and create to Users service #617updateById, deleteById, create + bound entity methods
  3. This PRinvite

Cloudflare CORS worker: all five endpoints already whitelisted (api/User/{x} pattern).

🤖 Generated with Claude Code

});

it('should throw when the user ID is undefined', async () => {
const user = createUserWithMethods(createBasicUser({ id: undefined as any }), mockService);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The as any cast is unnecessary. createBasicUser accepts Partial<RawUserGetResponse>, which makes id type string | undefined, so { id: undefined } is valid TypeScript without a cast. Same issue on line 69.

Convention: "No any type — use unknown if truly unknown, then validate."

Suggested change
const user = createUserWithMethods(createBasicUser({ id: undefined as any }), mockService);
const user = createUserWithMethods(createBasicUser({ id: undefined }), mockService);

@claude

claude Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review summary

New finding posted this run:

  • tests/unit/models/identity/users.test.ts lines 51 & 69 — unnecessary as any casts. createBasicUser takes Partial<RawUserGetResponse>, which makes id type string | undefined, so { id: undefined } compiles without any cast. Suggestion posted on line 51 (same fix applies to line 69).

Everything else checked out — transform pipeline, endpoint routing, type naming, pagination absence, JSDoc on UserServiceModel, @track decorators, barrel exports, and integration test cleanup patterns all follow CLAUDE.md conventions.

@Sarath1018
Sarath1018 marked this pull request as ready for review July 21, 2026 04:27
@Sarath1018
Sarath1018 requested a review from a team July 21, 2026 04:27
@Sarath1018
Sarath1018 force-pushed the feat/identity-users branch from fac9ccc to fbfb6ef Compare July 21, 2026 04:36
@Sarath1018 Sarath1018 changed the title feat(identity): onboard Identity user management endpoints as Users service feat(identity): add invite to Users service Jul 21, 2026
@Sarath1018
Sarath1018 changed the base branch from main to feat/identity-users-crud July 21, 2026 04:36
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://UiPath.github.io/uipath-typescript/pr-preview/pr-609/

Built to branch gh-pages at 2026-07-21 07:09 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@Sarath1018
Sarath1018 force-pushed the feat/identity-users branch from fbfb6ef to 42cce96 Compare July 21, 2026 04:42
@Sarath1018
Sarath1018 force-pushed the feat/identity-users-crud branch from c8571c5 to 5e31db9 Compare July 21, 2026 04:42
@claude

claude Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@Sarath1018
Sarath1018 force-pushed the feat/identity-users-crud branch from 5e31db9 to 3e38f55 Compare July 21, 2026 04:48
@Sarath1018
Sarath1018 force-pushed the feat/identity-users branch from 42cce96 to a6e787a Compare July 21, 2026 04:50
@claude

claude Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@Sarath1018
Sarath1018 force-pushed the feat/identity-users-crud branch from 3e38f55 to b94fcec Compare July 21, 2026 05:08
@Sarath1018
Sarath1018 force-pushed the feat/identity-users branch from a6e787a to cd68ac1 Compare July 21, 2026 05:08
@claude

claude Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@Sarath1018
Sarath1018 force-pushed the feat/identity-users-crud branch from b94fcec to 7288fc2 Compare July 21, 2026 06:59
Sarath1018 and others added 2 commits July 21, 2026 12:32
Final slice of the Identity user management onboarding (follows the getById
and CRUD PRs):

- invite(users)  POST /api/User/InviteUsers

Each invited user receives an invitation email with an accept link. The API
reports per-user outcomes — the request can succeed overall while individual
invitations fail (e.g. disallowed redirect URL), surfaced via the renamed
errorMessage field.

Live-API findings encoded: redirectUrl is effectively required and must be a
portal acceptInvite URL (the API gateway host is rejected per-user with
"Redirect URL is not valid"); failed invitations return an all-zeros GUID.

Adds the optional UIPATH_PORTAL_URL integration test config for environments
where UIPATH_BASE_URL points at the API gateway host.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Sarath1018
Sarath1018 force-pushed the feat/identity-users branch from cd68ac1 to f29a250 Compare July 21, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant